package org.zpmis.domain.mail.model;

import lombok.Data;
import org.zpmis.domain.mail.enums.MailEnum;

import java.util.Map;

@Data
public class TemplateMailMessageParam extends MailBaseMessage{

    /**
     * 模板名称
     */
    private String templateName;

    /**
     * 模版参数
     */
    private Map<String, String> map;

    /**
     * 附件字节 集合 key为附件的名称 不传附件的时候可以为空
     */
    private Map<String,byte[]> bytes;

    public TemplateMailMessageParam() {
    }

    /**
     * 发送模板邮件带附件的邮件构造函数
     */
    public TemplateMailMessageParam(String toEmail, String ccEmail, String bccEmial, MailEnum mailEnum,Map<String, String> map, Map<String,byte[]> bytes) {
        super.setToEmial(toEmail);
        super.setCcEmail(ccEmail);
        super.setBccEmail(bccEmial);
        super.setSubject(mailEnum.subject());
        this.templateName = mailEnum.template();
        this.map = map;
        this.bytes = bytes;
    }

    /**
     * 发送模板邮件带附件的邮件构造函数
     */
    public TemplateMailMessageParam(String toEmail, MailEnum mailEnum, Map<String, String> map, Map<String,byte[]> bytes) {
        super.setToEmial(toEmail);
        super.setSubject(mailEnum.subject());
        this.templateName = mailEnum.template();
        this.map = map;
        this.bytes = bytes;
    }
}
